package com.wbsxch.rabbit.sender.controller;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SenderController {

    @Autowired
    private AmqpTemplate amqpTemplate;

    @GetMapping("/send")
    public String send(String info){
        amqpTemplate.convertAndSend("queue",info);
        return "发送成功";
    }
}
